﻿var tab0;
var oRows;
var iRowCount;
var tabFixed;

function Loader() {

    tab0 = $('tblData0');
    tabFixed = $('tblFixedResources');

    oRows = tab0.getElementsByTagName('tr');
    oRowsInterna = tabFixed.getElementsByTagName('tr');

    iRowCount = oRows.length;
    iRowInternaCount = oRowsInterna.length;

    for (i = 0; i < oRowsInterna.length; i++) {
        oRowsInterna[i].height = oRows[i].offsetHeight - 8;
    }
}

function ResizeDiv(divId) {
    tab0 = $(divId);
    tabFixed = $('tblFixedResources');

    oRows = tab0.getElementsByTagName('tr');
    oRowsInterna = tabFixed.getElementsByTagName('tr');

    iRowCount = oRows.length;
    iRowInternaCount = oRowsInterna.length;

    for (i = 0; i < oRowsInterna.length; i++) {
        oRowsInterna[i].height = oRows[i].offsetHeight - 8;
    }
}

function ShowOrHide(id) {

    var m = id.getAttribute("NAME");
    //mRep = m.replace("chk", "row");

    mRep0 = m.replace("chk", "rowData") + "0";
    mRep1 = m.replace("chk", "rowData") + "1";
    mRep2 = m.replace("chk", "rowData") + "2";
    mRep3 = m.replace("chk", "rowData") + "3";

    if ($('' + m).checked) {
        //$('' + mRep).appear();
        $('' + mRep0).appear();
        $('' + mRep1).appear();
        $('' + mRep2).appear();
        $('' + mRep3).appear();
    }
    else {
        //$('' + mRep).fade();
        $('' + mRep0).fade();
        $('' + mRep1).fade();
        $('' + mRep2).fade();
        $('' + mRep3).fade();
    }
}

function showToolTip(e) {

    var lixlpixel_tooltip = $('tooltip');

    alert(lixlpixel_tooltip);

    if (lixlpixel_tooltip.style.display == '') {
        lixlpixel_tooltip.fade();
    }
    else {
        lixlpixel_tooltip.style.pixelLeft = (e.x + 325 + document.body.scrollLeft);
        lixlpixel_tooltip.style.pixelTop = (e.y + 30 + document.body.scrollTop);
        lixlpixel_tooltip.appear();
    }
}

var current = "parentDiv01";

function Next() {
    if (current != "parentDiv04") $(current).fade();

    if (current == "parentDiv01") { current = "parentDiv02"; $('imgPrevious').src = "images/previous.gif"; $('imgPrevious').style.cursor = "hand"; }
    else
        if (current == "parentDiv02") { current = "parentDiv03"; }
    else
        if (current == "parentDiv03") { current = "parentDiv04"; $('imgNext').src = "images/next_disable.gif"; $('imgNext').style.cursor = "default"; }

        var t = setTimeout("$('" + current + "').appear();", 1000);        
}

function Previous() {
    if (current != "parentDiv01") $(current).fade();

    if (current == "parentDiv04") { current = "parentDiv03"; $('imgNext').src = "images/next.gif"; $('imgNext').style.cursor = "hand"; }
    else
        if (current == "parentDiv03") { current = "parentDiv02"; }
    else
        if (current == "parentDiv02") { current = "parentDiv01"; $('imgPrevious').src = "images/previous_disable.gif"; $('imgPrevious').style.cursor = "default"; }

    var t = setTimeout("$('" + current + "').appear();", 1000);
}